#ifndef CONNECTIONDIALOG_H
#define CONNECTIONDIALOG_H
#include <QtGui>
#include "ui_ConnectionDialog.h"
#include <client/dbclient.h>
using namespace mongo;
#include "dbconnection.h"

//use multi thread to connect mongodb

class ConnectionDialog :public QDialog, public Ui::ConnectionDialogBase
{
    Q_OBJECT
public:
    ConnectionDialog(QWidget* parent=0);
signals:
    void requestConnectParamater(QString connectName,
            DBClientConnection* clientConnect);
private slots:
    void readSettings();
    void saveSetting();
    void removeSetting();
    void connect2DataBase();
    void clearCurrent();
protected:
    QList<QMap<QString,QVariant> > connectionSettings;
public:
    QString connectGroupName;
    QString defaultConnectName;
    DBClientConnection* connection;
    void doConnect();
};

#endif // CONNECTIONDIALOG_H
